The Diagram Cache

Cacheing diagram printouts works like this: dvilj determines the diagram's leaf name and saves the printout of that diagram with that leaf name in the cache directory (see below).
This means that if you want to cache your diagrams you'll have to have unique leaf names for all your diagrams. The alternative would have been to store the printouts in the same directory as the original diagram and hacking the name a bit. I can't think of a decent system to name these printouts, though, and most of all I don't like the idea of having rather large files all over my harddisk; so I prefer the cache directory approach by far.
The cache directory is created in the document folder. It consists of a base name 6 characters in length5with a decimal number appended. That number is the base resolution in dpi (e.g. 600) times the current magnification. This system ensures that dvilj doesn't use printouts that were created with the wrong dimensions when you're printing at a different magnification or resolution. On the other hand if you're printing at 300 dpi with a magnification of 1 you'll be getting printouts with exactly the same dimensions as if you had been printing at 600 dpi with a magnification of 0.5; that's the reason for using the product of these two parameters.
The default base name for the cache directory is LJdiag, so diagrams printed at a base resolution of 600 dpi with magnification 1 will be stored / looked for in LJdiag600. Changing magnification to ${\frac{{2}}{{3}}}$rds will result in a cache directory of LJdiag400 and so forth.
Whenever dvilj encounters a diagram it first attempts to find a file with the same leaf name in the appropriate cache directory . If such a file is found and its time stamp is from a later date than that of the actual diagram then the printout is used directly. Otherwise a printout is created using the currently active printer driver; this printout will be either <Wimp$Scrap> (no cacheing, gets deleted after use) or the name of the cache directory plus the diagram's leaf name (cacheing). This system may lead to some inconsistencies which will be discussed now.